package com.haoze.nurseapp.service.feign;


import com.haoze.common.response.Result;
import com.haoze.nurseapp.dto.CheckForNurseDTO;
import com.haoze.nurseapp.dto.TaskCopyNodeDTO;
import com.haoze.nurseapp.dto.TaskFileDTO;
import com.haoze.nurseapp.model.EmrFileIndexEntity;
import feign.Headers;
import feign.hystrix.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@Service
@Headers("Content-Type:application/json")
@FeignClient(name = "api-doctor" ,url = "http://localhost:8115",fallback = FallbackFactory.Default.class, configuration = FeignSupportConfig.class)
public interface PatientOrderService {
    /**
     * 创建下个节点
     * @param currentTaskExecuteDetailId
     * @param userId
     * @param groupId
     * @param msgContent
     * @param executeBeginTime  yyyy-MM-dd hh:mm:ss
     */
    @RequestMapping(value = "/nurse/order/createNextTaskNode", method = RequestMethod.GET)
    void createNextTaskNode(@RequestParam String currentTaskExecuteDetailId,@RequestParam Integer batchNo,  @RequestParam String userId,
                              @RequestParam String groupId, @RequestParam String msgContent,@RequestParam String executeBeginTime,@RequestParam String qrCode);

    /**
     * 拷贝同级节点
     * @param taskCopyNodeDTO
     */
    @RequestMapping(value = "/doctor/order/copyLastNode", method = RequestMethod.POST)
    void copyLastNode(@RequestBody TaskCopyNodeDTO taskCopyNodeDTO);

    /**
     * 批量创建下个节点
     * @param taskExecuteDetailEntityMap
     * @param msgContent
     */
    @RequestMapping(value = "/nurse/order/createNextTaskNodeList",method = RequestMethod.POST)
    Result createNextTaskNodeList(@RequestBody List<Map<String,Object>> taskExecuteDetailEntityMap, @RequestParam String msgContent);

    /**
     * 执行输液中心新增穿刺保存任务
     * @param taskFileDTO
     */
    @RequestMapping(value = "/doctor/order/executeTask", method = RequestMethod.POST)
    String executeTask(@RequestBody TaskFileDTO taskFileDTO);

    /**
     * 根据tplId创建文书
     * @param map
     */
    @RequestMapping(value = "/doctor/order/createTaskNodeOrderFileIndex",method = RequestMethod.POST)
    EmrFileIndexEntity createTaskNodeOrderFileIndex(@RequestBody Map<String,Object> map);

    /**
     * 智慧药学接口判断是否过敏
     * @param checkForNurseDTO
     * @return
     */

    @PostMapping("/commonCtl/checkForNurse")
    Result checkForNurse(@RequestBody CheckForNurseDTO checkForNurseDTO);
}
